//
//  UserInfo.m
//  iFlickr
//
//  Created by 张 霄鹤 on 09-7-3.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "UserInfo.h"


@implementation UserInfo

@synthesize nsid;

@synthesize userName;

@synthesize fullName;

@synthesize location;

@synthesize photosURL;

@synthesize profileURL;

@synthesize auth_token;

@synthesize perms;

/**
 * 将所有字段保存在 字典中
 */
-(NSDictionary *)saveInfos{
	NSDictionary *ret = [NSDictionary dictionaryWithObjectsAndKeys:nsid,@"nsid",auth_token,@"token",
						 userName,@"username",fullName,@"fullname",perms,@"perms",nil,nil];
	return ret;
}

/**
 * 从infos中装载配置数据到对象中
 * @param 对象
 */
-(void)loadInfos:(NSDictionary *)infos{
	self.nsid = [infos objectForKey:@"nsid"];
	self.auth_token = [infos objectForKey:@"token"];
	self.userName = [infos objectForKey:@"username"];
	self.fullName = [infos objectForKey:@"fullname"];
	self.perms = [infos objectForKey:@"perms"];
}

@end
